$(function () {
    $.get("./goodsAndShoppingCart/getGoodsType.php", function (date) {
        // console.log(date);
        // let arr=[];
        // for(let i = 0;i<date.length;i++){
        //     if(date[i].typeId>0&&date[i].typeId<9){
        //         arr.push(date[i]);
        //     }
        // }
        // console.log(arr);
        fun(date);
    }, "json")
    function fun(date) {
        let oLis = " ";
        for (let i = 0; i < date.length; i++) {
            // console.log(date[i]);
            oLis += `
            <li class="nav_m_1 first-nav-li">
                <a href="#">${date[i].goodsType}
                    <div class="navm1">
                        <ul class='na'>

                        </ul>
                    </div>
                </a>

            </li>
            `
        }
        $(".nav_mid").append(oLis);
    }
})



$(function () {
    $.get("./goodsAndShoppingCart/getGoodsList.php", "{goodsId:001}", function (date) {
        // console.log(date);
        let arr1 = []
        for (let i = 0; i < date.length; i++) {
            if (date[i].goodsId > 0 && date[i].goodsId < 7) {
                arr1.push(date[i])
            }
        }

        fun(arr1)
    }, "json")
    function fun(arr1) {
        let olis = " ";

        for (let i = 0; i < arr1.length; i++) {
            // console.log(arr1[i]);
            olis += ` <li>
                                <img src="${arr1[i].goodsImg}" alt="">
                                <p>${arr1[i].goodsName}</p>
                                <p class='r'>${arr1[i].goodsPrice}元起</p>
                            </li>`
        }
        $(".na").append(olis)
    }
})


